<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('company', function (Blueprint $table) {
            $table->id(); // 主键，自增长，非空
            $table->unsignedInteger('user_id')->default(0); // int not null default 0
            $table->string('company_name', 225)->default(''); // varchar(225) not null default ''
            $table->string('application_number', 225)->default(''); // string(225) not null default ''
            $table->text('address')->nullable(); // 可为空
            $table->string('phone')->nullable(); // 可为空
            $table->string('email')->nullable(); // 可为空
            $table->tinyInteger('status')->default(0); // tinyint not null default 0
            $table->timestamp('fraud_verif_time')->nullable(); // 可为空
            $table->timestamps(); // created_at 和 updated_at
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('company');
    }
};